package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.dto.VisitDto;
import com.zzyl.entity.Member;
import com.zzyl.entity.Visit;
import com.zzyl.vo.TimeCountVo;
import com.zzyl.vo.UserTime;
import com.zzyl.vo.VisitVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @Description CustomerUserMapper
 * @Author luohai
 * @Date 2024-10-20
 */
@Mapper
public interface CustomerUserMapper {
    /**
     * 根据openId查询成员
     * @param openId
     * @return
     */
    @Select("SELECT * from member where open_id =#{openId}")
    Member searchUserByOpenId(String openId);

    void update(Member member);


    void save(Member member);

    /**
     * 新增预约
     * @param visit
     * @return
     */
    void addAppointment(Visit visit);

    /**
     * 分页查询预约
     * @param status
     * @return
     */
    Page<VisitVo> pageQueryReservation(Integer status);

    /**
     * 取消预约
     * @param id
     */
    void cancelReservation(Long id);

    /**
     * 查询每个时间段剩余预约次数
     * @param localDateTime
     * @return
     */
    List<TimeCountVo> remainingReservationTimes(LocalDateTime localDateTime);

    /**
     * 查询取消预约数量
     * @return
     */

    Integer queryTheNumberOfCancelledAppointments(Long id);


    void addTimer();
}
